package com.scap.dfs.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.*;

/**
 * The primary key class for the DAILY_CAL_FORMULA_CONFIG database table.
 * 
 */
@Embeddable
public class DailyCalFormulaConfigPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="FORMULA_ID",columnDefinition="int")
	private Integer formulaId;

	@Column(name="HOSPITAL_CODE",columnDefinition="NVARCHAR(50)")
	private String hospitalCode;

	@Column(name="SHARING_BEGIN",columnDefinition="numeric(19, 2)")
	private BigDecimal sharingBegin;

	@Column(name="SHARING_END",columnDefinition="numeric(19, 2)")
	private BigDecimal sharingEnd;

	@Column(name="VAR1_VALUE",columnDefinition="nvarchar(100)")
	private String var1Value;

	@Column(name="VAR2_VALUE",columnDefinition="nvarchar(100)")
	private String var2Value;

	@Column(name="VAR3_VALUE",columnDefinition="nvarchar(100)")
	private String var3Value;

	@Column(name="ADMISSION_TYPE",columnDefinition="nvarchar(5)")
	private String admissionType;

	@Column(name="INVOICE_TYPE",columnDefinition="nvarchar(10)")
	private String invoiceType;

	public DailyCalFormulaConfigPK() {
	}

	public Integer getFormulaId() {
		return formulaId;
	}

	public void setFormulaId(Integer formulaId) {
		this.formulaId = formulaId;
	}

	public String getHospitalCode() {
		return hospitalCode;
	}

	public void setHospitalCode(String hospitalCode) {
		this.hospitalCode = hospitalCode;
	}

	public BigDecimal getSharingBegin() {
		return sharingBegin;
	}

	public void setSharingBegin(BigDecimal sharingBegin) {
		this.sharingBegin = sharingBegin;
	}

	public BigDecimal getSharingEnd() {
		return sharingEnd;
	}

	public void setSharingEnd(BigDecimal sharingEnd) {
		this.sharingEnd = sharingEnd;
	}

	public String getVar1Value() {
		return var1Value;
	}

	public void setVar1Value(String var1Value) {
		this.var1Value = var1Value;
	}

	public String getVar2Value() {
		return var2Value;
	}

	public void setVar2Value(String var2Value) {
		this.var2Value = var2Value;
	}

	public String getVar3Value() {
		return var3Value;
	}

	public void setVar3Value(String var3Value) {
		this.var3Value = var3Value;
	}

	public String getAdmissionType() {
		return admissionType;
	}

	public void setAdmissionType(String admissionType) {
		this.admissionType = admissionType;
	}

	public String getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((admissionType == null) ? 0 : admissionType.hashCode());
		result = prime * result
				+ ((formulaId == null) ? 0 : formulaId.hashCode());
		result = prime * result
				+ ((hospitalCode == null) ? 0 : hospitalCode.hashCode());
		result = prime * result
				+ ((invoiceType == null) ? 0 : invoiceType.hashCode());
		result = prime * result
				+ ((sharingBegin == null) ? 0 : sharingBegin.hashCode());
		result = prime * result
				+ ((sharingEnd == null) ? 0 : sharingEnd.hashCode());
		result = prime * result
				+ ((var1Value == null) ? 0 : var1Value.hashCode());
		result = prime * result
				+ ((var2Value == null) ? 0 : var2Value.hashCode());
		result = prime * result
				+ ((var3Value == null) ? 0 : var3Value.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DailyCalFormulaConfigPK other = (DailyCalFormulaConfigPK) obj;
		if (admissionType == null) {
			if (other.admissionType != null)
				return false;
		} else if (!admissionType.equals(other.admissionType))
			return false;
		if (formulaId == null) {
			if (other.formulaId != null)
				return false;
		} else if (!formulaId.equals(other.formulaId))
			return false;
		if (hospitalCode == null) {
			if (other.hospitalCode != null)
				return false;
		} else if (!hospitalCode.equals(other.hospitalCode))
			return false;
		if (invoiceType == null) {
			if (other.invoiceType != null)
				return false;
		} else if (!invoiceType.equals(other.invoiceType))
			return false;
		if (sharingBegin == null) {
			if (other.sharingBegin != null)
				return false;
		} else if (!sharingBegin.equals(other.sharingBegin))
			return false;
		if (sharingEnd == null) {
			if (other.sharingEnd != null)
				return false;
		} else if (!sharingEnd.equals(other.sharingEnd))
			return false;
		if (var1Value == null) {
			if (other.var1Value != null)
				return false;
		} else if (!var1Value.equals(other.var1Value))
			return false;
		if (var2Value == null) {
			if (other.var2Value != null)
				return false;
		} else if (!var2Value.equals(other.var2Value))
			return false;
		if (var3Value == null) {
			if (other.var3Value != null)
				return false;
		} else if (!var3Value.equals(other.var3Value))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "DailyCalFormulaConfigPK [formulaId=" + formulaId
				+ ", hospitalCode=" + hospitalCode + ", sharingBegin="
				+ sharingBegin + ", sharingEnd=" + sharingEnd + ", var1Value="
				+ var1Value + ", var2Value=" + var2Value + ", var3Value="
				+ var3Value + ", admissionType=" + admissionType
				+ ", invoiceType=" + invoiceType + "]";
	}
	
	
	
}